const { defineConfig } = require('@vue/cli-service')
const { VantResolver } = require('unplugin-vue-components/resolvers');
const ComponentsPlugin = require('unplugin-vue-components/webpack');
module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    proxy: {
      // https://haokan.baidu.com/videoui/api/videorec
      //视频一
      '/videoui': {
        target: 'https://haokan.baidu.com',
        ws: false,
        changeOrigin: true,
        headers: {
          referer: 'https://haokan.baidu.com/v?vid=7885508454932182729&source=1022897c-0-1023778d&pkg=1023778d&ckey=CK1448646945528',
        }
      },
    }
  },
  configureWebpack: {
    plugins: [
      ComponentsPlugin({
        resolvers: [VantResolver()],
      }),
    ],
  },
})

// module.exports = {
//   configureWebpack: {
//     plugins: [
//       ComponentsPlugin({
//         resolvers: [VantResolver()],
//       }),
//     ],
//   },
// };